package com.fuxue.mapper;

import com.fuxue.dto.LikeDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.GetMapping;

@Mapper
public interface LikeMapper {
    @Select("select answer_id from answer where q_id = #{id}")
    Integer GetAnswerId(Integer id);
   @Insert("insert into `like` (user_id,answer_id,time,type)"+"values"+"(#{userId},#{answerId},#{time},#{type})")
    void AddLike(LikeDTO likeDTO);
@Update("update server set point = point + 2 where server_id = #{serverId}")
    void addPoint(Integer serverId);
}
